Optimal. Leaf size=69 \[ -\frac {a-b x}{2 \left (a^2+b^2\right ) \left (b+2 a x-b x^2\right )}-\frac {b \tanh ^{-1}\left (\frac {a-b x}{\sqrt {a^2+b^2}}\right )}{2 \left (a^2+b^2\right )^{3/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {628, 632, 212}
\begin {gather*} -\frac {a-b x}{2 \left (a^2+b^2\right ) \left (2 a x-b x^2+b\right )}-\frac {b \tanh ^{-1}\left (\frac {a-b x}{\sqrt {a^2+b^2}}\right )}{2 \left (a^2+b^2\right )^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 628
Rule 632
Rubi steps
\begin {align*} \int \frac {1}{\left (b+2 a x-b x^2\right )^2} \, dx &=-\frac {a-b x}{2 \left (a^2+b^2\right ) \left (b+2 a x-b x^2\right )}+\frac {b \int \frac {1}{b+2 a x-b x^2} \, dx}{2 \left (a^2+b^2\right )}\\ &=-\frac {a-b x}{2 \left (a^2+b^2\right ) \left (b+2 a x-b x^2\right )}-\frac {b \text {Subst}\left (\int \frac {1}{4 \left (a^2+b^2\right )-x^2} \, dx,x,2 a-2 b x\right )}{a^2+b^2}\\ &=-\frac {a-b x}{2 \left (a^2+b^2\right ) \left (b+2 a x-b x^2\right )}-\frac {b \tanh ^{-1}\left (\frac {a-b x}{\sqrt {a^2+b^2}}\right )}{2 \left (a^2+b^2\right )^{3/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 78, normalized size = 1.13 \begin {gather*} \frac {\frac {-a+b x}{b+2 a x-b x^2}-\frac {b \tan ^{-1}\left (\frac {-a+b x}{\sqrt {-a^2-b^2}}\right )}{\sqrt {-a^2-b^2}}}{2 \left (a^2+b^2\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.58, size = 83, normalized size = 1.20
method | result | size |
default | \(\frac {-2 b x +2 a}{\left (-4 a^{2}-4 b^{2}\right ) \left (-b \,x^{2}+2 a x +b \right )}+\frac {2 b \arctanh \left (\frac {-2 b x +2 a}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (-4 a^{2}-4 b^{2}\right ) \sqrt {a^{2}+b^{2}}}\) | \(83\) |
risch | \(\frac {\frac {b x}{4 a^{2}+4 b^{2}}-\frac {a}{4 \left (a^{2}+b^{2}\right )}}{-\frac {1}{2} b \,x^{2}+a x +\frac {1}{2} b}+\frac {b \ln \left (\left (a^{2} b +b^{3}\right ) x +\left (a^{2}+b^{2}\right )^{\frac {3}{2}}-a^{3}-a \,b^{2}\right )}{4 \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}-\frac {b \ln \left (\left (-a^{2} b -b^{3}\right ) x +\left (a^{2}+b^{2}\right )^{\frac {3}{2}}+a^{3}+a \,b^{2}\right )}{4 \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\) | \(134\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.52, size = 97, normalized size = 1.41 \begin {gather*} -\frac {b \log \left (\frac {b x - a - \sqrt {a^{2} + b^{2}}}{b x - a + \sqrt {a^{2} + b^{2}}}\right )}{4 \, {\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}} + \frac {b x - a}{2 \, {\left (a^{2} b + b^{3} - {\left (a^{2} b + b^{3}\right )} x^{2} + 2 \, {\left (a^{3} + a b^{2}\right )} x\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 171 vs.
\(2 (65) = 130\).
time = 3.39, size = 171, normalized size = 2.48 \begin {gather*} -\frac {2 \, a^{3} + 2 \, a b^{2} + {\left (b^{2} x^{2} - 2 \, a b x - b^{2}\right )} \sqrt {a^{2} + b^{2}} \log \left (\frac {b^{2} x^{2} - 2 \, a b x + 2 \, a^{2} + b^{2} + 2 \, \sqrt {a^{2} + b^{2}} {\left (b x - a\right )}}{b x^{2} - 2 \, a x - b}\right ) - 2 \, {\left (a^{2} b + b^{3}\right )} x}{4 \, {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5} - {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} x^{2} + 2 \, {\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} x\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 218 vs.
\(2 (56) = 112\).
time = 0.29, size = 218, normalized size = 3.16 \begin {gather*} - \frac {b \sqrt {\frac {1}{\left (a^{2} + b^{2}\right )^{3}}} \log {\left (x + \frac {- a^{4} b \sqrt {\frac {1}{\left (a^{2} + b^{2}\right )^{3}}} - 2 a^{2} b^{3} \sqrt {\frac {1}{\left (a^{2} + b^{2}\right )^{3}}} - a b - b^{5} \sqrt {\frac {1}{\left (a^{2} + b^{2}\right )^{3}}}}{b^{2}} \right )}}{4} + \frac {b \sqrt {\frac {1}{\left (a^{2} + b^{2}\right )^{3}}} \log {\left (x + \frac {a^{4} b \sqrt {\frac {1}{\left (a^{2} + b^{2}\right )^{3}}} + 2 a^{2} b^{3} \sqrt {\frac {1}{\left (a^{2} + b^{2}\right )^{3}}} - a b + b^{5} \sqrt {\frac {1}{\left (a^{2} + b^{2}\right )^{3}}}}{b^{2}} \right )}}{4} + \frac {a - b x}{- 2 a^{2} b - 2 b^{3} + x^{2} \cdot \left (2 a^{2} b + 2 b^{3}\right ) + x \left (- 4 a^{3} - 4 a b^{2}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.91, size = 90, normalized size = 1.30 \begin {gather*} -\frac {b \log \left (\frac {{\left | 2 \, b x - 2 \, a - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, b x - 2 \, a + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{4 \, {\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}} - \frac {b x - a}{2 \, {\left (b x^{2} - 2 \, a x - b\right )} {\left (a^{2} + b^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.32, size = 100, normalized size = 1.45 \begin {gather*} -\frac {\frac {a}{2\,\left (a^2+b^2\right )}-\frac {b\,x}{2\,\left (a^2+b^2\right )}}{-b\,x^2+2\,a\,x+b}+\frac {b\,\mathrm {atan}\left (\frac {a\,b^2\,1{}\mathrm {i}+a^3\,1{}\mathrm {i}-b\,x\,\left (a^2+b^2\right )\,1{}\mathrm {i}}{{\left (a^2+b^2\right )}^{3/2}}\right )\,1{}\mathrm {i}}{2\,{\left (a^2+b^2\right )}^{3/2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________